<?php
class Usuarios_Model_Usuario extends Mylibrary_Mymodel_Base{
	protected $_id;
	protected $_usuario;
	protected $_senha;
	protected $_nome;
	protected $_email;
	protected $_telefone;
	protected $_id_perfil;
	protected $_registro;
	protected $_perfil;

	
	// ##########################################
	public function setId($id) {
		$this->_id = ( int ) $id;
		return $this;
	}
	public function getId() {
		return $this->_id;
	}
	// ------------------------------#
	public function setUsuario($text) {
		$this->_usuario = ( string ) $text;
		return $this;
	}
	public function getUsuario() {
		return $this->_usuario;
	}
	// ------------------------------#
	public function setSenha($text) {
		$this->_senha = ( string ) $text;
		return $this;
	}
	public function getSenha() {
		return $this->_senha;
	}
	// ------------------------------#
	public function setNome($text) {
		$this->_nome = ( string ) $text;
		return $this;
	}
	public function getNome() {
		return $this->_nome;
	}
	// ------------------------------#
	public function setEmail($text) {
		$this->_email = ( string ) $text;
		return $this;
	}
	public function getEmail() {
		return $this->_email;
	}
	// ------------------------------#
	public function setTelefone($text) {
		$this->_telefone = ( int ) $text;
		return $this;
	}
	public function getTelefone() {
		return $this->_telefone;
	}
	// ------------------------------#
	public function setId_perfil($text) {
		$this->_id_perfil = ( int ) $text;
		return $this;
	}
	public function getId_perfil() {
		return $this->_id_perfil;
	}
	// ------------------------------#
	public function setRegistro($text) {
		$this->_registro = $text;
		return $this;
	}
	public function getRegistro() {
		return $this->_registro;
	}
	// ------------------------------#
	public function setPerfil($text) {
		$perfils = array ();
		if (count ( $text ) > 1) {
			foreach ( $text as $perfil ) {
				$perfils [] = $perfil->nome;
			}
			$this->_perfil = explode ( ", ", $perfils );
		} else {
			$this->_perfil = current($text)->nome;
		}
		return $this;
	}
	public function getPerfil() {
		return $this->_perfil;
	}
}

